package cn.edu.sdjzu.xg.eagle.Service;



import cn.edu.sdjzu.xg.eagle.entity.Condition;
import cn.edu.sdjzu.xg.eagle.entity.Pagination;
import cn.edu.sdjzu.xg.eagle.entity.School;
import cn.edu.sdjzu.xg.eagle.exception.BaseException;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.Collection;
import java.util.List;

/**
 * @author tg.si@188.com
 * @project xg22
 * @date 2024/3/26
 */
public interface SchoolDaoService {
    /**
     * 返回id对应的School对象
     *
     * @param id 对象对应的id
     * @return School对象
     * @throws SQLException
     */
    School findSchool(Long id) throws SQLException, BaseException;

    /**
     * 返回某页上的School对象
     * @param pagination 分页对象(页号, 每页面对象数)
     * @return School对象集合
     * @throws SQLException
     */

    //分页查询
    Collection<School> findSchoolsWithPagination(Pagination pagination) throws SQLException, BaseException ;

    /**
     * 返回School所有对象
     * @return School对象集合
     * @throws SQLException
     */
    //直接显示所有信息
    Collection<School> findSchools() throws SQLException, BaseException ;

    boolean deleteSchool(Long id) throws SQLException ;
    boolean updateSchool(Connection connection, School school) throws SQLException;

    boolean addSchool(Connection connection, School school) throws SQLException;
    boolean deleteSchool(School school) throws SQLException;
}
